package com.example.demo.exception;

import com.example.demo.enums.ResultEnums;

/**
 * Created by wangbing on 2018/3/29.
 */

public class GirlException extends RuntimeException {
    /**
     * spring框架默认对RuntimeException进行事务回滚，而不会对Exception回滚
     */

    private Integer code;
    public GirlException(ResultEnums resultEnums){
        super(resultEnums.getMsg());
        this.code = resultEnums.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
